function check() {
    if(document.getElementsByName("cardType")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Card type should not be null."
        return false;
    }
    if(document.getElementsByName("creditCard")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Credit card should not be null."
        return false;
    }
    if(document.getElementsByName("expiryDate")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Expiry date should not be null."
        return false;
    }
    if(document.getElementsByName("billToFirstName")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Bill to first name should not be null."
        return false;
    }
    if(document.getElementsByName("billToLastName")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Bill to last name should not be null."
        return false;
    }
    if(document.getElementsByName("billAddress1")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Bill address1 should not be null."
        return false;
    }
    if(document.getElementsByName("billAddress2")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Bill address2 should not be null."
        return false;
    }
    if(document.getElementsByName("billCity")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Bill city should not be null."
        return false;
    }
    if(document.getElementsByName("billState")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Bill state should not be null."
        return false;
    }
    if(document.getElementsByName("billZip")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Bill zip should not be null."
        return false;
    }
    if(document.getElementsByName("billCountry")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Bill country should not be null."
        return false;
    }
    if(document.getElementsByName("shipToFirstName")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Ship to first name should not be null."
        return false;
    }
    if(document.getElementsByName("shipToLastName")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Ship to last name should not be null."
        return false;
    }
    if(document.getElementsByName("shipAddress1")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Ship address1 should not be null."
        return false;
    }
    if(document.getElementsByName("shipAddress2")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Ship address2 should not be null."
        return false;
    }
    if(document.getElementsByName("shipCity")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Ship city should not be null."
        return false;
    }
    if(document.getElementsByName("shipState")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Ship state should not be null."
        return false;
    }
    if(document.getElementsByName("shipZip")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Ship zip should not be null."
        return false;
    }
    if(document.getElementsByName("shipCountry")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Ship country should not be null."
        return false;
    }
    if(document.getElementsByName("courier")[0].value == "") {
        document.getElementsByName("errormsg")[0].innerText = "Courier should not be null."
        return false;
    }
    return true;
}